package com.yang.jdbc02;

import com.yang.util.JDBCUtil02;

import java.sql.Connection;
import java.sql.ResultSet;

/**
 * @author yangjiming
 * @create 2021-03-26 22:15
 */
public class selectJDBC01 {
    public static void main(String[] args) throws Exception{
        Connection conn = JDBCUtil02.getConnection();
        String sql = "select * from student";

        ResultSet rs = JDBCUtil02.selectAll(sql);
        while (rs.next()){
            String name = rs.getString("name");
            int age = rs.getInt("age");
            String sex = rs.getString("sex");
            System.out.println(name+"---"+age+"---"+sex);
        }
        JDBCUtil02.close();
    }
}
